<template>
  <div class="con">
    <table border="1">
      <tr>
        <th>序号</th>
        <th>型号</th>
        <th>价格</th>
        <th>时间</th>
        <th>操作</th>
      </tr>

      <tr v-for="(item, index) in list" :key="item.id">
        <td>{{ item.id }}</td>
        <td>{{ item.title }}</td>
        <td>{{ item.price | filprice("¥") }}</td>
        <td>{{ item.time | filtime }}</td>
        <td><span @click="remove(index)">删除</span></td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  props: ["list"],
  data() {
    return {};
  },
  mounted() {},
  methods: {
    remove(index) {
      this.$emit("remove", index);
    },
  },
  components: {},
  filters: {
    filprice(val, a) {
      return val + a;
    },
  },
};
</script>

<style lang="scss">
.con {
  table {
    width: 800px;
    margin: 0 auto;
  }
}
</style>
